﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Ninject;
using System.Reflection;
using Ninject.Modules;

namespace Scala.UI
{
    public class GUIModule : NinjectModule
    {
        public override void Load()
        {
            Bind<Main>().ToSelf();            
        }
    }


    static class Helper
    {
        static StandardKernel kernel;
        static bool inited;        

        public static void InitIoC()
        {
            if (!inited)
            {
                kernel = new StandardKernel();
                var assemblies = new List<Assembly>();
                kernel.Load(new List<Assembly>() { Assembly.Load("Scala.IoC"), Assembly.Load("Scala.UI") });
                inited = true;
            }
        }

        public static T GetActual<T>()
        {
            return (T)kernel.Get<T>();
        }       
    }
}
